<template>
  <div>
    <div class="header">热销推荐</div>
    <div class="item" @click="clickItem(item)" v-for="item in items" :key="item.id">
      <img class="img" :src="item.imgUrl"/>
      <div class="content">
        <div class="title">{{item.title}}</div>
        <div class="desc">{{item.desc}}</div>
        <div class="btn" @click="clickItem(item)">查看详情</div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'recommond',
    props: {
      list: Array
    },
    computed: {
      items () {
        return this.list
      }
    },
    methods: {
      clickItem (item) {
        this.$router.push('detail/id=' + item.id)
      }
    }
  }
</script>

<style lang="stylus" type="text/stylus" rel="stylesheet/stylus" scoped>
  @import '~styles/varibles.styl'
  @import '~styles/mixins.styl'
  ///*.icons >>> .swiper-container*/

  .header
    height $headerHeight
    background-color #EEEEEE
    color #333
    padding-left 0.1rem
    font-size 0.16rem
    margin 0 auto
    line-height $headerHeight

  .item
    display flex
    padding 0.05rem

    .img
      width 0.85rem
      height 0.85rem
      float left

    .content
      flex 1
      min-width: 0
      padding 0.05rem

      .title
        color #333333
        font-size .16rem

      .desc
        margin-top 0.1rem
        color #666
        ellipsis()
        font-size .12rem

      .btn
        color white
        margin-top 0.1rem
        display: inline-block
        border-radius 0.05rem
        padding 0.05rem 0.1rem
        background-color #FF9300
        font-size .14rem

</style>
